﻿/*********************
*验证用户用户名是否重复
************************/
function VatUserName()
{
    var userName=document.getElementById("txtAccounts").value;
    if(userName=="")
    {
        alert("用户名为空!"); 
        return;   
    }
    
      $j.ajax
      (
        {
            type:"POST",
            url:"/Handler/UserReg.ashx",
            data:"userName=" + userName, 
            success: function(ret)
            {
                if(ret == "0")
                {
                   NameTS('用户名可以使用','Green'); 
                }
                else
                {
                  if(ret == "1"||ret == "2" ||ret == "3")
                  {
                     NameTS('用户名重复,请重新输入!','Red');
                  }
                  else
                  {
                    NameTS(ret,'Red')
                  }  
                }
            },
            error: function()
            {
              
            }
        }
      );
}
